#pragma once
#include <string>

struct Config {
    std::string can_device;
    int can_bitrate;
    int web_port;
    int motor_left_id;
    int motor_right_id;
    int heartbeat_id;
    int heartbeat_interval_ms;
    int control_interval_ms;
    int accel_per_sec;
    int max_speed;
    int default_speed;
    int min_speed;
    int keyboard_repeat_timeout_ms;

    // 摄像头配置
    int camera_width = 640;       // 摄像头分辨率宽
    int camera_height = 480;      // 摄像头分辨率高
    int camera_fps = 30;          // 摄像头帧率
    std::string camera_device = "/dev/video0"; // USB 摄像头设备节点
};

bool loadConfig(const std::string &path, Config &cfg);
